/**
 * Custom FilterPipeline for the UOM (notifies the table of changes to keep the consistency of the model)
 * 
 * @author remo.lemma@lu.unisi.ch
 */

package ch.unisi.inf.projects.java.uom.gui.table.item;

import org.jdesktop.swingx.decorator.Filter;
import org.jdesktop.swingx.decorator.FilterPipeline;
import org.jdesktop.swingx.decorator.SortController;
import org.jdesktop.swingx.decorator.Sorter;
import org.jdesktop.swingx.decorator.ShuttleSorter;

import ch.unisi.inf.projects.java.uom.gui.table.UOMItemJTable;

public class UOMFilterPipeline extends FilterPipeline
{
	
	final UOMItemJTable table;
	
    public UOMFilterPipeline(final UOMItemJTable table)
    {
        this(table, new Filter[] {});
    }
    
    public UOMFilterPipeline (final UOMItemJTable table, final Filter[] filters)
    {
    	super(filters);
    	this.table = table;
    }

    protected SortController createDefaultSortController()
    {
        return new UOMSortController();
    }

    protected class UOMSortController extends SorterBasedSortController
    {
        protected Sorter createDefaultSorter()
        {
        	return new ShuttleSorter();
        }
    }
}
